diff --git a/swh/web/browse/snapshot_context.py b/swh/web/browse/snapshot_context.py --- a/swh/web/browse/snapshot_context.py +++ b/swh/web/browse/snapshot_context.py @@ -302,7 +302,7 @@ branches[branch_alias]["name"] = branch_alias ret_branches = list(sorted(branches.values(), key=lambda b: b["name"])) - ret_releases = list(sorted(releases.values(), key=lambda b: b["name"])) + ret_releases = list(sorted(releases.values(), key=lambda b: b["branch_name"])) return ret_branches, ret_releases, resolved_aliases diff --git a/swh/web/browse/templates/browse-releases.html b/swh/web/browse/templates/browse-releases.html --- a/swh/web/browse/templates/browse-releases.html +++ b/swh/web/browse/templates/browse-releases.html @@ -17,7 +17,8 @@ <table class="table swh-table swh-table-striped"> <thead> <tr> - <th><i class="{{ swh_object_icons.release }} mdi-fw" aria-hidden="true"></i>Name</th> + <th><i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i>Branch name</th> + <th><i class="{{ swh_object_icons.release }} mdi-fw" aria-hidden="true"></i>Release name</th> <th>Target</th> <th>Message</th> <th>Date</th> @@ -27,13 +28,19 @@ {% if displayed_releases|length > 0 %} {% for release in displayed_releases %} <tr class="swh-release-entry swh-tr-hover-highlight"> - <td class="swh-release-name"> + <td class="swh-branch-name"> <a href="{{ release.release_url }}"> {% if release.alias %} <i class="{{ swh_object_icons.alias }} mdi-fw" aria-hidden="true"></i> {% else %} - <i class="{{ swh_object_icons.release }} mdi-fw" aria-hidden="true"></i> + <i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i> {% endif %} + {{ release.branch_name }} + </a> + </td> + <td class="swh-release-name"> + <a href="{{ release.release_url }}"> + <i class="{{ swh_object_icons.release }} mdi-fw" aria-hidden="true"></i> {{ release.name }} </a> </td> diff --git a/swh/web/browse/tests/views/test_snapshot.py b/swh/web/browse/tests/views/test_snapshot.py --- a/swh/web/browse/tests/views/test_snapshot.py +++ b/swh/web/browse/tests/views/test_snapshot.py @@ -390,8 +390,10 @@ query_params=query_params, ) - assert_contains(resp, '<a href="%s">' % escape(browse_release_url)) - assert_contains(resp, '<a href="%s">' % escape(browse_revision_url)) + assert_contains(resp, release["branch_name"]) + assert_contains(resp, release["name"]) + assert_contains(resp, f'<a href="{escape(browse_release_url)}">') + assert_contains(resp, f'<a href="{escape(browse_revision_url)}">') _check_origin_link(resp, origin_info["url"])